﻿using Gateway.Domain.EFCore.Configuration;
using Gateway.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace Gateway.Domain.Configuration;

public class LanguageExtensionCodeConfiguration : AggregateRootEntityConfiguration<LanguageExtensionCode>
{
    public override void Configure(EntityTypeBuilder<LanguageExtensionCode> builder)
    {
        builder.ToTable(t => t.HasComment("语言下的 扩展类库"));
        builder.Property(x => x.Title).HasMaxLength(500).IsRequired().HasComment("显示的标题");
        builder.Property(x => x.Name).HasMaxLength(500).IsRequired().HasComment("代码的文件名称");
        builder.Property(x => x.Code).IsRequired().HasComment("代码");
        builder.Property(x => x.LanguageId).IsRequired().HasComment("运行语言的标识");
        base.Configure(builder);
    }
}